package com.yunji.app.order;

import com.yunji.aggregate.service.OrderAggregateService;
import com.yunji.common.base.BaseController;
import com.yunji.order.business.TradeBusiness;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Package com.yunji.app.order
 * FileName:	GateWayTradeController.java
 * Copyright:	Copyright © 2024 云集互联 All Rights Reserved
 * Company:		云集互联
 * @version: 1.0
 * @since: JDK 1.8.0_202
 * Create at:   2024-04-13 19:50:59
 * Description:
 * 交易模块
 * Modification History:
 * Author					Date						Version			Description
 * --------------------------------------------------------------------------------
 * HuaAo				2024-04-13 19:50:59			1.0				1.0 Version
 */
@RestController
@Api(tags = "移动端-交易模块")
@RequestMapping("/gateway/trade/")
public class AppTradeController extends BaseController {
    @Resource
    private TradeBusiness business;

    @Resource
    private OrderAggregateService aggregate;

//    @ApiOperation("钱包支付交易(商品支付)")
//    @PostMapping(value = "/purseTrade")
//    @ApiImplicitParam(name = "tradeCode", value = "订单ID", dataType = "Integer", dataTypeClass = Integer.class)
//    public Response<String> purseTrade(Long orderId) {
//        business.purseTrade(orderId);
//        return ResponseHelper.success();
//    }

//    @ApiOperation("微信充值交易(充值支付)")
//    @PostMapping("/wechatRecharge")
//    @ApiImplicitParam(name = "tradeCode", value = "订单ID", dataType = "Integer", dataTypeClass = Integer.class)
//    public Response<WechatTrade> wechatRecharge(Long orderId) {
//        return ResponseHelper.success(business.wechatRecharge(orderId));
//    }

//    @ApiOperation("提现交易")
//    @PostMapping("/payouts")
//    @ApiImplicitParam(name = "tradeCode", value = "订单ID", dataType = "Integer", dataTypeClass = Integer.class)
//    public Response<WechatTrade> payouts(Long orderId) {
//        return ResponseHelper.success(business.wechatRecharge(orderId));
//    }
//
//    @ApiOperation("员工交易明细列表")
//    @GetMapping("/list")
//    public Response<List<TradeVO>> list(TradeParam trade) {
//        LoginInfo user = SystemContext.getUser();
//        trade.setUserId(user.getUserId());
//        String[] types = {UserType.STAFF.getCode()};
//        trade.setUserTypes(types);
//        List<TradeVO> list = aggregate.searchTrade(trade);
//        return ResponseHelper.successWithPage(list);
//    }
}
